package org.sparkle.db.group;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

import org.sparkle.db.basic.BaseVO;
import org.sparkle.db.user.UserVO;

import com.avaje.ebean.validation.NotNull;

@Entity
@Table(name = "spk_group")
public class GroupVO extends BaseVO {

	/**
	 * 
	 */
	private static final long serialVersionUID = 9210690320887430075L;
	@NotNull
	private String name;
	@ManyToMany(cascade=CascadeType.ALL)
	private List<UserVO> users;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public List<UserVO> getUsers() {
		if(users==null)
			users=new ArrayList<UserVO>(0);
		return users;
	}

	public void setUsers(List<UserVO> users) {
		this.users = users;
	}

}
